-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Eng 50]
| Dao creation network switch
#2645
Conversation
✅ Deploy Preview for decent-interface-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested against Coinbase and TokenPocket wallet extensions. CB works fine because when the app request the wallet to change network, it just does it. TP has a little problem.
Steps:
- Connect TP wallet with Ethereum selected.
- Create a DAO in our app. Select "Sepolia" as the network.
- Note, TP shows prompt to change network. If you click "Cancel", it keeps on prompting. Click on "Confirm" now.
- Click "Next"
- In TP, switch network back to "Ethereum". Note, immediately, it shows a badge with "1" label. If you click on it, it is asking you to switch back to Sepolia. However, the badge is not super obvious and user may miss it.
- Create NFT DAO with 0x31408f226E37FBF8715CA6eE45aaB4Ea213bA7A5 as address (this issue should happen with ERC-20 DAO too). You will see the address is red with error because it is now using Ethereum mainNet to check the address.
Conclusion, there are many wallet variations and different network switching flows, that may still cause two source of truth in our app.
I think we should ignore the wallet network selection during our flow, and only prompt the wallet to switch network at signing (so only one source of truth with user selected network in the app)
Let's discussed this on a call when available. |
Another related issue: When connected to Wallet Connect (Metamask), switching the network in app causes the MM wallet to repeatedly prompt to switch network to the point of wallet not usable. |
As discussed, I will approve it and create new ticket for follow-up to deal with network switching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed about single source of truth. Creating a new ticket to handle the others
Closes https://linear.app/decent-labs/issue/ENG-50/dev-error-creating-an-nft-dao
So the problem is that I placed the useEffect within the EstablishEssentials form rather than higher up.
This move makes it if the User switches there network at some point later in the process, the app switches it back keeping the user on the selected network.
I did attempt to move this selection and network check to the button, but with the current setup within
useBuildDAOTx
where it pulls contracts fromuseNetworkConfigStore
in which is set to the current network.A future refactor will be needed to confirm to a new pattern of more fine control over what network the DAO is deployed on.
Testing:
Basically our now app now prevents the user from manually switching thier network via wallet during this workflow. Not ideal to be so connected to that network. but without some refactoring how the contracts for deployment are chosen this is the most effective method to ensure proper deployment